<%@ page pageEncoding="UTF-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/functions" prefix="fn"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt"%>
<%@ taglib uri="http://www.ld.com/shield/tags" prefix="shield"%>
<%@ taglib uri="http://www.ld.com/system/tags" prefix="system"%>
<%@ page trimDirectiveWhitespaces="true" %>
<fmt:setLocale value="zh_CN"/>
<%-- 权限判断 --%>
<system:permssion type="button">
<form action="${ctxPathA}/usercenter/calender/addOrUpdate" method="post" autocomplete="off" class="show-info">
	<shield:token/>
    <input id="id" name="id" type="hidden" maxlength="100" value="${model.id }">
    <input type="hidden" name="cid" value="${model.cid}">
    <table class="tab-show">
    	<colgroup>
    		<col width="20%">
    		<col width="">
    	</colgroup>
        <tr>
	    	<th>
            	<label><font color="red">*</font>标题：</label>
        	</th>
         	<td><input type="text" name="title" value="${model.title}"></td>
		</tr>
        <tr>
	    	<th>
            	<label>内容：</label>
        	</th>
         	<td><input type="text" name="content" value="${model.content}"></td>
		</tr>
		<tr>
	    	<th>
            	<label><font color="red">*</font>开始时间：</label>
        	</th>
         	<td>
         		<fmt:formatDate value="${model.startTime}" pattern="yyyy-MM-dd" var="startDate"/>
         		<fmt:formatDate value="${model.startTime}" pattern="HH:mm" var="sTime"/>
         		<fmt:formatDate value="${model.endTime}" pattern="HH:mm" var="eTime"/>
	<c:if test="${not empty start }">
		<c:set var="startDate" value="${start }"></c:set>
	</c:if>
         	<input type="text" name="sDate" value="${startDate }" class="Wdate" placeholder="年月日" >
         	<input type="text" name="sTime" value="${sTime=='00:00'?'':sTime }" placeholder="时分" class="timeDropper ignore" style="width: 40px;">
         	<img class="clearHm" alt="清空时分" title="清空时分" src="${ctxPath }/images/icon/cancel.png?20190319105452"/>
         	</td>
		</tr>
		<tr>
	    	<th>
            	<label>结束时间：</label>
        	</th>
         	<td><input type="text" name="eDate" value='<fmt:formatDate value="${model.endTime}" pattern="yyyy-MM-dd"/>' class="Wdate" placeholder="年月日">
         		<input type="text" name="eTime" value="${eTime=='00:00'?'':eTime }" placeholder="时分" class="timeDropper" style="width: 40px;">
         		<img class="clearHm" alt="清空时分" title="清空时分" src="${ctxPath }/images/icon/cancel.png?20190319105452"/>
         	</td>
		</tr>
        <tr>
	    	<th>
            	<label>背景色：</label>
        	</th>
         	<td><input type="text" name="bgcolor" value="${model.bgcolor}"></td>
		</tr>
        <tr>
	    	<th>
            	<label>超链接：</label>
        	</th>
         	<td><input type="text" name="url" value="${model.url}"></td>
		</tr>
        <tr>
	    	<th>
            	<label>是否重复：</label>
        	</th>
         	<td>
         		<select name="repeatType" data-v="${model.repeatType }" class="shieldSelectRelated">
         			<option value="0">一次性事件</option>
         			<option value="1" relatedTo="#repataTimesSet">重复</option>
         		</select>
         	</td>
		</tr>
		<tr id="repataTimesSet">
	    	<th>
            	<label>重复频率：</label>
        	</th>
         	<td>
         		每<input style="width: 40px;" type="text" name="frequency" class="digits" value="${model.frequency }"/>
				<label style="width: 1px;"></label>
				<select name="repeatUnit" data-v="${model.repeatUnit }">
					<option value="1">天</option>
					<option value="2">周</option>
					<option value="3">月</option>
					<option value="4">年</option>
				</select>
				<label style="width: 50px;margin-left: 0px;">一次,</label>
				<label style="width: 40px;margin-left: 2px;">重复</label>
				<input style="width: 40px;" type="text" name="repataTimes" class="digits" value="${model.repataTimes }"/><label style="width: 10px;margin-left: 2px;">次</label>
         	</td>
		</tr>
    </table>
    <div class="taCenter">
		<input class="button" type="submit" value="提交"/>
    	<input class="button default" type="reset" value="重置"/>
    </div>
</form>
</system:permssion>
<script>
$(".timeDropper").timeDropper({meridians:false, setCurrentTime:false, format:'HH:mm'});
$(".clearHm").unbind("click").bind("click", function(){
	$(this).prev(":input").val("");
})
</script>
